home *** CD-ROM | disk | FTP | other *** search
- /*
- * a header of the class COMPONENT_ELEMENT
- * Copyright (C) 1996, 1997 Kazutaka Hirata <khirata@jove.acs.unt.edu>
- */
-
- #ifndef _COMPELEM_H_
- #define _COMPELEM_H_
-
- #include "prim.h"
-
- class COMPONENT_ELEMENT : public PRIMITIVE {
- bool m_select;
- public:
- // constructors
-
- COMPONENT_ELEMENT()
- : PRIMITIVE(),
- m_select(false) {}
- COMPONENT_ELEMENT(const COMPONENT_ELEMENT& src)
- : PRIMITIVE(src),
- m_select(src.m_select) {}
- COMPONENT_ELEMENT(const PRIMITIVE& src)
- : PRIMITIVE(src),
- m_select(false) {}
-
- // operators
-
- bool operator==(const COMPONENT_ELEMENT& rval) const { return true; }
- bool operator!=(const COMPONENT_ELEMENT& rval) const { return true; }
- bool operator< (const COMPONENT_ELEMENT& rval) const { return true; }
- bool operator> (const COMPONENT_ELEMENT& rval) const { return true; }
-
- bool is_selected() const { return m_select; }
- void select () { m_select = true ; }
- void unselect() { m_select = false; }
-
- // block-related
-
- void shift(const XY& ac_dif, COMPONENT_ELEMENT& target) const;
-
- // miscellaneous
-
- bool is_in_block(const XY& ac1, const XY& ac2) const;
-
- int load_170(FILE_NEW& fp);
- };
-
- #endif /* _COMPELEM_H_ */
-